package com.pro.controller;

import com.pro.domain.Record;
import com.pro.service.RecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@CrossOrigin
public class RecordController {

    @Autowired
    private RecordService recordService;

    /**
     * Get seat condition of theater room in some certain period
     * @param filmId
     * @param trId
     * @param cinemaId
     * @param startTime
     * @param endTime
     * @return
     */
    @GetMapping("/querySeatCondition")
    public List<Record> querySeatCondition(Long filmId, Long trId, Long cinemaId, String startTime, String endTime) {
        return recordService.querySeatCondition(filmId, trId, cinemaId, startTime, endTime);
    }

}
